package tea.servlet;
import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import stu.dao.StudentDaoImpl;
import tea.dao.teaDaoImpl;

/**
 * Servlet implementation class DelteaCourse
 */
@WebServlet("/DelteaCourse")
public class DelteaCourse extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
   
    public DelteaCourse() {
        super();
        // TODO Auto-generated constructor stub
    }

	
	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		request.setCharacterEncoding("UTF-8");
		response.setCharacterEncoding("UTF-8");
		response.setContentType("text/html;charset=utf-8");
		String cname= request.getParameter("cname");
		teaDaoImpl h1 = new teaDaoImpl();
		if(cname != null){
			h1.delcourseTea(cname);
		}
		request.getRequestDispatcher("FindteaCourse").forward(request, response);
	}

	

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) 
			throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
